package cn.jason.org.service.impl;

import cn.jason.basic.service.impl.BaseServiceImpl;
import cn.jason.basic.util.PageList;
import cn.jason.org.domain.Employee;
import cn.jason.org.mapper.EmployeeMapper;
import cn.jason.org.query.EmployeeQuery;
import cn.jason.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService  {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public PageList<Employee> queryPage(EmployeeQuery query) {
        Long total = employeeMapper.queryCount(query);
        List<Employee> rows = employeeMapper.queryData(query);
        return new PageList<Employee>(total,rows);
    }
}
